Add support for multiple named OpenAI chat models in Spring Boot starter#162
Conversation
53db89b to
5a0dbf9
Compare
|
@ThomasVitale I would appreciate a review from you, if you have some spare time 🙏 |
Tcharl
left a comment
There was a problem hiding this comment.
I'm really interested in that feature personnally
| private static final String STREAMING_CHAT_MODEL_PREFIX = PREFIX + ".streaming-chat-model"; | ||
|
|
||
| private static final Set<String> KNOWN_PROPERTIES = Set.of( | ||
| "base-url", "api-key", "organization-id", "project-id", "model-name", |
There was a problem hiding this comment.
Strong typing and specific class would have been better IMHO
|
@dliubarskyi I somehow didn't see your tag until now, sorry for the late answer. Spring Framework 7/Spring Boot 4 introduced the Based on the decision on how to introduce support for Spring Boot 4 in LangChain4j, you might consider introducing support for multiple chat models only in the Spring Boot 4 variant using the |
|
@ThomasVitale thanks a lot for the insights! |
Issue
Closes langchain4j/langchain4j#4286
Change
Add support for multiple named OpenAI chat models in Spring Boot starter.
Configuration
Usage
Implementation
BeanDefinitionRegistryPostProcessorto dynamically register named model beansEnvironmentfor unknown property keys underchat-model.*prefixProperties.java- 100% backwards compatibleChatModelListenercallbacks and Spring RestClient integrationBean Naming Convention
chat-model.fast.*openAiChatModelFastchat-model.4-1-mini.*openAiChatModel41MiniGeneral checklist
Checklist for adding new Spring Boot starter
N/A - This PR modifies an existing starter.